<div class="row">
<div class="col-xs-12">
	<div class="box">
		<div class="box-header">
			<form id="auto-query-form" class="form-inline" method="post" role="form">
				<div class="form-group">
					<label class="control-label" for="query.keyword">关键字</label>
					<input id="query.keyword" name="query.keyword" placeholder="请输入关键字" class="form-control"/>
				</div>
				<div class="form-group">
					<label class="control-label" for="query.stime">访问时间</label>
					<input id="query.stime" name="query.stime" value="#(query.stime??)" placeholder="访问时间始" class="form-control date" datetimepicker="yyyy-mm-dd" maxlength="19"/>
					<label class="control-label" for="query.etime">至</label>
					<input id="query.etime" name="query.etime" value="#(query.etime??)" placeholder="访问时间止" class="form-control date" datetimepicker="yyyy-mm-dd" maxlength="19"/>
				</div>	
				<div class="form-group">
					#@query_btn()
				</div>
			</form>
		</div>

		<div class="box-body">
			<table id="auto_data_table" class="table table-striped table-hover table-bordered dataTable no-footer" width="100%">
			</table>
		</div>

		<div class="box-footer text-center">
			#@del_btn("log/access/index",true)
			#@auth_btn("clear","按条件清空","log/access/index",true,"btn-danger","fa fa-trash")
		</div>
	</div>
</div>
</div>
<script type="text/javascript">
	$(document).ready(function() {
		var dtSelf = $('#auto_data_table').autoDataTable({
			controller : "log/access",
			title : "访问日志",
			columns : [
			   { "data" : "user_code", "name" : "user_code", "title" : "用户代码" },
			   { "data" : "user_name", "name" : "user_name", "title" : "用户名称" },
			   { "data" : "client_ip", "name" : "client_ip", "title" : "客户端IP" },
			   { "data" : "server_ip", "name" : "server_ip", "title" : "服务器IP" },
			   { "data" : "uri", "name" : "uri", "title" : "目标URI" },
			   { "data" : "access_time", "name" : "access_time", "title" : "访问时间" }
			]
		});
		
		$("#clear_btn").click(function(){
			confirmDialog("<strong class='text-danger'>确定要按查询条件清空日志吗？</strong>", function() {
				var datas={keyword:jid("query.keyword").val(),stime:jid("query.stime").val(),etime:jid("query.etime").val()};
				postData("log/access/clear", datas, null, function(data) {
					if(data.success)dtSelf.fnDraw();
				});
			});
		});
	});
</script>